Scanner devices which read images using optical units include scanner devices using contact image sensors (CIS) and scanner devices using charge coupled devices (CCD). For the scanner device using CIS, a manuscript may be required to be attached to a reading surface. The scanner device using CIS is not able to read a three-dimensional manuscript. However, compared with the scanner device using CCD, thickness of the main body for the scanner device using CIS can be reduced and the price is lower. Furthermore, for the scanner device using CIS, a technique to reduce noise which tends to appear on a read image has been improved. Thus the scanner device using CIS has been widely used. For example, CIS is used for reading the reverse side in an image reading device having a single-pass duplex scanning function.
CIS uses RGB light-emitting diodes (LED) as light sources. The RGB light beams are rapidly switched and the light beams from the manuscript are input to an imaging device (CMOS image sensor) through a lens. In response to this, the CMOS image sensor converts the input light beams into voltage values on a pixel-by-pixel basis, and outputs.
The scanner device using CIS adopts a contact image sensor method in which a manuscript is close contact with the sensor by a roller, and the manuscript is read on a line-by-line basis. A reading part is formed by arranging plural short sensors in their longitudinal directions. This is because it is difficult to manufacture a single long CIS. However, in this case, constant gaps are provided between the sensors. Image signals are not obtained at the gaps. Consequently, defects on the image signal occur.
Further, in a scanner device, an image signal may be missed or a read image signal may indicate an incorrect value, when a sensor reading the image signal is malfunctioning, or when an obstructing material exists, such as a smear on a contact glass on the light path on which a manuscript is to be set.
There has been a problem that an image quality is lowered by the missing pixels in the read image or by the existence of pixels having incorrect pixel values in the read image. In view of this problem, conventionally a technique has been known in which pixel values of missing pixels or incorrect pixel values are estimated using pixel values around the pixels, and the pixel values of missing pixels or the incorrect pixel values are replaced by the estimated values.
For example, a linear interpolation method using pixel values of the pixels surrounding the objective pixels, a polynomial interpolation method or a spline interpolation method using two or more functions can be considered. The interpolation method based on a linear interpolation is suitable for interpolation of a portion at which the density variation is small. However, the interpolation method based on linear interpolation is not suitable for an interpolation of a portion at which the density variation is large, such as a halftone dot area.
The interpolation methods based on a polynomial interpolation or a spline interpolation can estimate the pixel values with high precision for a digital photograph and the like, for which the sampling period for sampling the image is sufficiently shorter than a fluctuating period of a pattern of the image. However, for a halftone dot image, since resolution of the image is not sufficient in comparison with the number of lines of the halftone dot, a sampling period is not sufficiently shorter than a fluctuating period. Thus, with this interpolation method, there are many cases in which an original pattern is not correctly reconstructed.
Therefore, in order to resolve the problem of the interpolation methods, a method using pattern matching has been proposed. In this method, it is expected that a high frequency component, which cannot be reconstructed using the interpolation methods, can be reconstructed using similar patterns in the vicinity of the interpolation pixels.
However, in general, in pattern matching, since a wider range of information is used compared to the interpolation methods, an optimum solution can be obtained for a pattern which is used as a reference, however, the optimum solution is not always optimum for the interpolation pixels. This problem occurs, because, when a similar pattern is searched for during pattern matching, a pattern which includes plural small differences from the reference pattern as a whole and a pattern which coincides with the reference pattern in major portions, but including a small portion that is greatly different from the corresponding portion in the reference pattern are not distinguished.
Especially, for a case in which information is eccentrically-located at a specific pixel, such as a halftone dot area in which there are many lines, a selection method for selecting a similar pattern affects greatly on an interpolation result. Further, in a low density halftone dot area, since a percentage of pixels belonging to the background is relatively high, a similar pattern may be detected in the background area, which is not the halftone dot area, or, conversely, a similar pattern may not be detected.
Thus, when performing an interpolation, it may be necessary to select an interpolation method depending on a characteristic of an area to which an interpolation pixel belongs. Therefore, in order to accurately estimate a pixel value of the interpolation pixel, a device has been proposed such that, when a position of the interpolation pixel is within a halftone dot area, a pattern which is similar to the pattern, including the interpolation pixel, is searched for in the image, and the device determines a pixel value of the interpolation pixel to be a pixel value of a pixel corresponding to the interpolation pixel in the most similar pattern (cf. Patent Document 1 (Japanese Registered Patent No. 4330164)).
The device determines whether the position of a pixel to be interpolated corresponding to a connected portion of contact image sensors are within a halftone dot area or within a non-halftone dot area based on image data read by an image reading sensor. When the position of the pixel to be interpolated is within the non-halftone dot area, the device generates pixel data for the pixel to be interpolated based on a linear interpolation, and interpolates the position of the pixel to be interpolated with the pixel data. On the other hand, when the position is within the halftone dot area, the device generates pixel data for the pixel to be interpolated based on a pattern matching, and interpolates the position of the pixel to be interpolated with the pixel data.
At this time, within an image area in the vicinity of the position of the pixel to be interpolated, a standard block including the pixel to be interpolated and plural reference blocks having the same size as the standard block and not including the pixel to be interpolated are defined. Based on the pixel data within the standard block and the pixel data within each reference block, a correlation value between the standard block and the corresponding reference block is calculated. In the pixel data included in the reference block, which has the highest correlation with the standard block, pixel data of the pixel which is corresponding to the pixel to be interpolated within the standard block are determined as the pixel data of the pixel to be interpolated.
However, with this interpolation method, there is a problem that for an image in which pixel values minutely vary, the interpolation can be performed with high precision, but for an image in which pixel values significantly vary, the degree of precision of the interpolation is severely degraded. Further, the determination of whether the position of the interpolation pixel is in the halftone dot area or in the non-halftone dot area is performed based on a global characteristic. Therefore, in a case in which a global characteristic and a local characteristic contradict, for example, there is a problem that the interpolation fails for a boundary line between a halftone dot area and a background area.
This is because, the determination of whether the position of the interpolation pixel is in the halftone dot area or in the non-halftone dot area is based on a periodicity of the pixel values in a line including the interpolation pixel. Further, there is a case such that when the position of the interpolation pixel is viewed as a relatively large area, such as one line, the area has a periodicity, but when the position of the interpolation pixel is viewed as a narrow area, such as the close vicinity of the interpolation pixel, the area does not have any periodicity. In such a case, it may be erroneously determined that the area has a periodicity. Incidentally, a non-halftone dot area in the vicinity of a halftone dot area and a non-halftone dot area sandwiched between two halftone dot areas tend to be erroneously determined. When the area is erroneously determined, a flat area outside the halftone dot area is interpolated as the halftone dot area. Consequently, an incorrect pixel value is generated.
Therefore, it has been desired to provide a device and a method such that, when a pixel value of an interpolation pixel is obtained, interpolation methods are switched depending on a global characteristic and a local characteristic, so that a higher precision pixel interpolation is realized, compared to a conventional one.